package pkmn.move.indirectAction;

import pkmn.Pokemon;
import pkmn.status.BattleStatusEnum;
import pkmn.type.Grass;
import pkmn.type.Type;

public class ApplySeed extends IndirectAction{
    public void execute(Pokemon pokemon){
        //don't work on grass types
        for (Type type : pokemon.getTypes()){
            if (type.equals(new Grass())){
                System.out.println(pokemon.getName() + " evade attack!");
                return;
            }
        }
        //verify if already seeded
        if (pokemon.haveBattleStatus(BattleStatusEnum.seed)) {
            System.out.println("But, it failed!");
            return;
        }
        //set status
        pokemon.setBattleStatus(BattleStatusEnum.seed);
        System.out.println(pokemon.getName() + " was seeded!");
    }
}
